import fetch from '@/utils/fetch';
import { EBIZ_API } from '@/config/baseUrl';

export function getCommerceList(params) {
	return fetch({
	    url: EBIZ_API + '/appAdmin_store/list.do',
	    method: 'get',
	    
	    params
  	})
}

export function getCommerceDetail(id) {
	return fetch({
	    url: EBIZ_API + `//appAdmin_store/getInfo?STORE_ID=${id}`,
	    method: 'get'
  	})
}

export function createCommerce(data) {
	return fetch({
		url: EBIZ_API + '/appAdmin_store/save.do',
		method: 'post',
		data
	})
}
export function modifyCommerce(data) {
	return fetch({
		url: EBIZ_API + '//appAdmin_store/edit.do',
		method: 'post',
		data
	})
}
export function timeCommerce(id) {
	return fetch({
		url: EBIZ_API + `//appAdmin_store_schedule/listAll.do?STORE_ID=${id}`,
		method: 'get',
		
	})
}


export const province = [ //省     	
	{"value":"110000","label": "北京"},
	{"value":"120000","label": "天津"},
	{"value":"130000","label": "河北省"},
	{"value":"140000","label": "山西省"},
	{"value":"150000","label": "内蒙古自治区"},
	{"value":"210000","label": "辽宁省"},
	{"value":"220000","label": "吉林省"},
	{"value":"230000","label": "黑龙江省"},
	{"value":"310000","label": "上海"},
	{"value":"320000","label": "江苏省"},
	{"value":"330000","label": "浙江省"},
	{"value":"340000","label": "安徽省"},
	{"value":"350000","label": "福建省"},
	{"value":"360000","label": "江西省"},
	{"value":"370000","label": "山东省"},
	{"value":"410000","label": "河南省"},
	{"value":"420000","label": "湖北省"},
	{"value":"430000","label": "湖南省"},
	{"value":"440000","label": "广东省"},
	{"value":"450000","label": "广西壮族自治区"},
	{"value":"460000","label": "海南省"},
	{"value":"500000","label": "重庆"},
	{"value":"510000","label": "四川省"},
	{"value":"520000","label": "贵州省"},
	{"value":"530000","label": "云南省"},
	{"value":"540000","label": "西藏自治区"},
	{"value":"610000","label": "陕西省"},
	{"value":"620000","label": "甘肃省"},
	{"value":"630000","label": "青海省"},
	{"value":"640000","label": "宁夏回族自治区"},
	{"value":"650000","label": "新疆维吾尔自治区"},
	{"value":"710000","label": "台湾省"},
	{"value":"810000","label": "香港特别行政区"},
	{"value":"820000","label": "澳门特别行政区"}
];

export const options = { //省     	
	"1": "超市店铺",
	"2": "餐饮店铺",
	"3": "团购店铺"
	
};
export const cancel = { //省     	
	
	"0": "未删除",
	"1": "已删除"
	
	
};
export const cancel_o = { //省     	
	"":"删除标记",
	"0": "未删除",
	"1": "已删除"
	
	
};

//更新经营时间
export function editTime(data){
	return fetch({
		url: EBIZ_API + '//appAdmin_store_schedule/edit2.do',
		method: "post",
		data
	})
}

//拉取市
export function getCityList(data){
	return fetch({
		url: EBIZ_API +'//appAdmin_order/getAreaList.do',
		method: 'post',
		data
	})
}

//删除店铺（逻辑）
export function deleteShop(data){
	return fetch({
		url: EBIZ_API + '/appAdmin_store/delete.do',
		method: 'post',
		data
	})
}

//拉取分类
export function getClassList(data){
	return fetch({
		url: EBIZ_API + '//appAdmin_category/listAll.do',
		method: 'post',
		data
	})
}

//新增餐饮分类
export function addRestaurantClass(data){
	return fetch({
		url: EBIZ_API + '//appAdmin_category/save.do',
		method: 'post',
		data
	})
}

//拉取分类详情
export function getClassDetail(params){
	return fetch({
		url:EBIZ_API + '/appAdmin_category/getInfo.do',
		method: 'get',
		params
	})
}

//编辑分类
export function editClass(data){
	return fetch({
		url:EBIZ_API +'//appAdmin_category/edit.do',
		method:'post',
		data
	})
}

//删除分类（逻辑）
export function deleteClass(data){
	return fetch({
		url: EBIZ_API+ '/appAdmin_category/delete.do',
		method: 'post',
		data
	})
}

//拉取商品详情
export function getGoodsDetail(params){
	return fetch({
		url: EBIZ_API + '/appAdmin_goods/getInfo.do',
		method: 'get',
		params
	})
}

//新增商品
export function addGoods(data){
	return fetch({
		url: EBIZ_API + '//appAdmin_goods/save.do',
		method: 'post',
		data
	})
}

//更新商品
export function editGoods(data){
	return fetch({
		url: EBIZ_API + '//appAdmin_goods/edit.do',
		method: 'post',
		data
	})
}

//营业/歇业【超市/餐饮】店铺
export function doBusiness(data) {
	return fetch({
		url: EBIZ_API + '/appAdmin_store/ex_status',
		method: 'post',
		data
	})
}